<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>业务单据-触发器</title>

<link rel="stylesheet" href="../lib/codemirror/codemirror.css">
<link rel="stylesheet" href="../lib/codemirror/addom/hint/show-hint.css">
<link rel="stylesheet" href="../lib/codemirror/theme/darcula.css">
<link rel="stylesheet" href="../lib/element-ui/index.css">
<link rel="stylesheet" href="./index.css">

<style type="text/css">

</style>


</head>
<body onload="Snail.app.init()">

	<div id="app">
	
		<el-form :model="formData.voucher" :inline="true" size="mini" style="width: calc(100% - 20px); height: 52px; padding: 10px 10px 0px 10px;">
			<el-form-item label="业务单据">
				<el-select v-model="formData.businessBills" placeholder="" @change="onBusinessBillsChange" filterable>
					<el-option v-for="item in businessBillsSelect.options" :key="item.value" :label="item.label" :value="item.value">
				</el-select>
			</el-form-item>
			<el-form-item>
				<el-button type="danger" @click="onReset">重载模板</el-button>
				<el-button type="danger" @click="onUpdateHisotory">更新历史触发</el-button>
				<el-button type="danger" @click="onIssueEventProcessor">发布事件实现</el-button>
			</el-form-item>
		</el-form>
								
		<el-tabs v-model="style.selectedIndex" @tab-click="onTabsChange" :before-leave="onTabsBeforeChange" class="app-config" style="height: calc(100% - 52px);">
			<el-tab-pane label="　业务字段映射　" name="first" height="100%" style="width: 100%; height: 100%; overflow: hidden;">
				<el-table :data="businessFieldTable.data" :tree-props="businessFieldTable.props" row-key="id" height="100%"
					style="width: 100%; height: 100%; margin-bottom: 20px;" default-expand-all>
					<el-table-column prop="key" label="业务字段键" width="250" header-align="center"></el-table-column>
					<el-table-column prop="title" label="业务字段标题" width="200" header-align="center" align="center"></el-table-column>
					<el-table-column prop="inKey" label="关联字段" width="200" header-align="center" align="center">
						<template slot-scope="scope">
							<el-select v-model="scope.row.inKey" v-if="!scope.row.children" placeholder="" filterable clearable>
								<el-option-group v-for="group in formFieldSelect.groups" :key="group.key" :label="group.label">
									<el-option v-for="item in group.options" :key="item.id" :label="item.label" :value="item.value">
								</el-option-group>
							</el-select>
						</template>
					</el-table-column>
					<el-table-column prop="type" label="关联类型" width="200" header-align="center" align="center">
						<template slot-scope="scope">
							<el-select v-model="scope.row.type" v-if="!scope.row.children" placeholder="" filterable>
								<el-option label="字符串" value="string"></el-option>
								<el-option label="数字" value="number"></el-option>
								<el-option label="日期" value="date"></el-option>
								<el-option label="日期时间" value="datetime"></el-option>
								<el-option label="枚举" value="enum"></el-option>
								<el-option label="枚举值" value="enum_value"></el-option>
								<el-option label="枚举编码" value="enum_code"></el-option>
								<el-option label="人员" value="member"></el-option>
								<el-option label="人员编码" value="member_code"></el-option>
								<el-option label="人员登录名" value="member_loginname"></el-option>
								<el-option label="人员手机号" value="member_telnumber"></el-option>
								<el-option label="人员办公电话" value="member_officenum"></el-option>
								<el-option label="人员E-mail" value="member_email"></el-option>
								<el-option label="人员身份证号" value="member_idnum"></el-option>
								<el-option label="部门" value="department"></el-option>
								<el-option label="部门编码" value="department_code"></el-option>
								<el-option label="单位" value="company"></el-option>
								<el-option label="单位编码" value="company_code"></el-option>
								<el-option label="岗位" value="post"></el-option>
								<el-option label="岗集编码" value="post_code"></el-option>
								<el-option label="职务级别" value="level"></el-option>
								<el-option label="职务级别编码" value="level_code"></el-option>
							</el-select>
						</template>
					</el-table-column>
					<el-table-column prop="defaultValue" label="默认值" width="300" header-align="center" align="center">
						<template slot-scope="scope">
							<el-input v-model="scope.row.defaultValue" v-if="!scope.row.children"></el-input>
						</template>
					</el-table-column>
					<el-table-column prop="desc" label="说明"></el-table-column>
				</el-table>
			</el-tab-pane>
			
			<el-tab-pane label="　属性配置　" name="second" height="100%" style="width: 100%; height: 100%; overflow: hidden;">
				<el-table :data="businessAttributeTable.data" row-key="id"  height="100%"
					style="width: 100%; height: 100%; margin-bottom: 20px;">
					<el-table-column prop="key" label="属性键" width="250" header-align="center"></el-table-column>
					<el-table-column prop="title" label="属性标题" width="200" header-align="center" align="center"></el-table-column>
					<el-table-column prop="inKey" label="关联字段" width="200" header-align="center" align="center">
						<template slot-scope="scope">
							<el-select v-model="scope.row.inKey" v-if="!scope.row.children" placeholder="" filterable clearable>
								<el-option-group v-for="group in formFieldSelect.groups" :key="group.key" :label="group.label">
									<el-option v-for="item in group.options" :key="item.id" :label="item.label" :value="item.value">
								</el-option-group>
							</el-select>
						</template>
					</el-table-column>
					<el-table-column prop="type" label="关联类型" width="200" header-align="center" align="center">
						<template slot-scope="scope">
							<el-select v-model="scope.row.type" v-if="!scope.row.children" placeholder="" filterable>
								<el-option label="字符串" value="string"></el-option>
								<el-option label="数字" value="number"></el-option>
								<el-option label="日期" value="date"></el-option>
								<el-option label="日期时间" value="datetime"></el-option>
								<el-option label="枚举" value="enum"></el-option>
								<el-option label="枚举值" value="enum_value"></el-option>
								<el-option label="枚举编码" value="enum_code"></el-option>
								<el-option label="人员" value="member"></el-option>
								<el-option label="人员编码" value="member_code"></el-option>
								<el-option label="人员登录名" value="member_loginname"></el-option>
								<el-option label="人员手机号" value="member_telnumber"></el-option>
								<el-option label="人员办公电话" value="member_officenum"></el-option>
								<el-option label="人员E-mail" value="member_email"></el-option>
								<el-option label="人员身份证号" value="member_idnum"></el-option>
								<el-option label="部门" value="department"></el-option>
								<el-option label="部门编码" value="department_code"></el-option>
								<el-option label="单位" value="company"></el-option>
								<el-option label="单位编码" value="company_code"></el-option>
								<el-option label="岗位" value="post"></el-option>
								<el-option label="岗集编码" value="post_code"></el-option>
								<el-option label="职务级别" value="level"></el-option>
								<el-option label="职务级别编码" value="level_code"></el-option>
							</el-select>
						</template>
					</el-table-column>
					<el-table-column prop="defaultValue" label="默认值" width="300" header-align="center" align="center">
						<template slot-scope="scope">
							<el-input v-model="scope.row.defaultValue"></el-input>
						</template>
					</el-table-column>
					<el-table-column prop="desc" label="说明"></el-table-column>
				</el-table>
			</el-tab-pane>
			
			<el-tab-pane label="　配置源码(JSON)　" name="thirdly" style="width: 100%; height: 100%;">
				<div class="app-codemirror">
					<textarea name="config_content" id="config_content"></textarea>
				</div>
			</el-tab-pane>
			
			<el-tab-pane label="　脚本　" name="fourthly" style="width: 100%; height: 100%;">
				<div class="app-codemirror">
					<textarea name="script_content" id="script_content"> 
#!/snail/common/utils groovy TRIGGER_XXXXXXXXXXXXXXXXXXXX

static main(args){
	
	// 待实现
	
}		
					</textarea>
				</div>
			</el-tab-pane>
		</el-tabs>
	
	</div>
	



	

<script type="text/javascript" src="../lib/vue.js"></script>

<script type="text/javascript" src="../lib/codemirror/codemirror.js"></script>
<script type="text/javascript" src="../lib/codemirror/groovy.js"></script>
<script type="text/javascript" src="../lib/codemirror/addom/hint/show-hint.js"></script>
<script type="text/javascript" src="../lib/codemirror/addom/hint/anyword-hint.js"></script>
<script type="text/javascript" src="../lib/codemirror/javascript.js"></script>

<script type="text/javascript" src="../lib/element-ui/index.js"></script>
	
<script type="text/javascript" src="../lib/snail.common.js"></script>
<script type="text/javascript" src="../lib/codemirror/groovy-hint.js"></script>
<script type="text/javascript" src="./index.js"></script>

</body>
</html>